export default {
  userSongslist (state, list) {
    state.userPlayList = [...list]
  },
  getNowMusic (state, url) {
    state.nowMusic = url
  },
  getnowMusicMenu (state, menu) {
    state.nowMusicMenu = { ...menu }
  },
  musicListIds (state, list) {
    state.musiclistId = [...list]
  },
  musicIndex (state, index) {
    state.nowMusicIndex = index
  },
  addMusicIndex (state) {
    if (state.musiclistId.length > 0 && state.nowMusicIndex + 1 < state.musiclistId.length) {
      state.nowMusicIndex++
    }
  },
  subMusicIndex (state) {
    if (state.musiclistId.length > 0 && state.nowMusicIndex - 1 >= 0) {
      state.nowMusicIndex--
    }
  },
  playStatus (state, flag) {
    state.isPlaying = flag
  },
  setMusicCount (state, num) {
    if (state.musiclistId.length > 0) {
      state.musicCount = num
    }
  },
  setVolume (state, volumeValue) {
    state.volumeValue = volumeValue
  },
  setShowTilt (state, flag) {
    state.showTilt = flag
  },
  setLyric (state, lyric) {
    state.lyric = lyric
  }
}
